﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace PalBattleEmulator
{
    static class GlobalConfig
    {
        public static int GRAPHIC_WIDTH = 640;
        public static int GRAPHIC_HEIGHT = 400;
        public static int GRAPHIC_DPIX = 96;
        public static int GRAPHIC_DPIY = 96;
        public static int GRAPHIC_BYTES_PER_PIXEL = 4;

        public static TimeSpan BATTLE_REDRAW_TIME = TimeSpan.FromMilliseconds(50);
        public static int GAME_CLOCK_SPAN = 50;

        public static string PATH_RESOURCE = @"resource\";
        public static string DIR_NAME_RESOURCE_CHARACTER = "character";
        public static string DIR_NAME_RESOURCE_ENEMY = "enemy";
        public static string DIR_NAME_RESOURCE_MAGIC = "magic";
        public static string DIR_NAME_RESOURCE_BATTLE_FIELD = "largebattlefield";

        public static string FILE_FORMAT_PICTURE_BATTLE_FIELD = "png";
        public static string FILE_FORMAT_PICTURE_CHARACTER = "png";
        public static string FILE_FORMAT_PICTURE_ENEMY = "png";
        public static string FILE_FORMAT_PICTURE_MAGIC = "png";
        public static char FILE_SPLIT_INDEX_FRAME = '-';

        public static string FILE_FORMAT_DATA_EXCEL = "xls";
        public static string FILE_FORMAT_DATA_XML = "xml";

        public static string PATH_DATA = @"data\";
        public static string DIR_NAME_DATA_EXCEL = "xls";
        public static string DIR_NAME_DATA_XML = "xml";
        public static string DATA_EXCEL_SHEET_NAME = "data";
        public static string DATA_XML_ROOT = "root";
        public static string DATA_XML_NODE = "data";

        public static string FILE_NAME_EXCEL_DATA_CHARACTER = "characters";
        public static string FILE_NAME_EXCEL_DATA_ENEMY = "enemys";
        public static string FILE_NAME_EXCEL_DATA_ARRAY_CHARACTER = "arrays";
        public static string FILE_NAME_EXCEL_DATA_ARRAY_ENEMY = "arrays";
        public static string FILE_NAME_EXCEL_DATA_MAGIC_EFFECT = "effects";

        public static string FILE_NAME_XML_DATA_CHARACTER = "characters";
        public static string FILE_NAME_XML_DATA_ENEMY = "enemys";
        public static string FILE_NAME_XML_DATA_ARRAY_CHARACTER = "arrays";
        public static string FILE_NAME_XML_DATA_ARRAY_ENEMY = "arrays";
        public static string FILE_NAME_XML_DATA_MAGIC_EFFECT = "effects";

        public static string EXCEL_SHEET_DATA_CHARACTER = "data";
        public static string EXCEL_SHEET_DATA_ENEMY = "data";
        public static string EXCEL_SHEET_DATA_ARRAY_CHARACTER = "character_arrays";
        public static string EXCEL_SHEET_DATA_ARRAY_ENEMY = "enemy_arrays";
        public static string EXCEL_SHEET_DATA_MAGIC_EFFECT = "magic_effects";

        public static string XML_ROOT_DATA_CHARACTER = "data";
        public static string XML_ROOT_DATA_ENEMY = "data";
        public static string XML_ROOT_DATA_ARRAY_CHARACTER = "character_arrays";
        public static string XML_ROOT_DATA_ARRAY_ENEMY = "enemy_arrays";
        public static string XML_ROOT_DATA_MAGIC_EFFECT = "magic_effects";

        public static int GAME_CONFIG_CHARACTER_COUNT = 6;

        //public static int GAME_CONFIG_GRAPHIC_ATTACK_LAST_TIMES

        public static string getPictureFilePath(string dirName, int index, int frame, string format)
        {
            string dirPath = Path.Combine(PATH_RESOURCE, dirName);
            string fileName = "";
            if(frame > 0) fileName = String.Format("{0}_{1}.{2}", index, frame, format);
            else fileName = String.Format("{0}.{1}", index, format);
            return Path.Combine(dirPath, fileName);
        }
    }
}
